genetic algorithm solved example